package com.temp_2;

import javax.jws.soap.SOAPBinding;

public class JumpingDemo {
    public static void main(String[] args) {
//        创建操作类
        JumpingOperator jumpingOperator = new JumpingOperator();
//        创建实体类
        Dog d = new Dog();
//        调用方法
        jumpingOperator.method(d);

        Cat c = new Cat();
        jumpingOperator.method(c);

//        用匿名类部类优化以上代码




        jumpingOperator.method(new Jumping() {
            @Override
            public void jump() {
                System.out.println("狗跳高！");
            }
        });
        jumpingOperator.method(new Jumping() {
            @Override
            public void jump() {
                System.out.println("猫跳高！");
            }
        });

    }
}
